package com.ccys.db.mapper;

import com.ccys.db.entity.TblPlanBenefitVoucher;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

/**
* Created by Mybatis Generator on 2023/12/15
*/
public interface TblPlanBenefitVoucherMapper extends Mapper<TblPlanBenefitVoucher>, MySqlMapper<TblPlanBenefitVoucher> {

    @Select("select t3.type " +
            "from tbl_plan_benefit_voucher t1 " +
            "left join tbl_plan_benefit t2 on t1.benefit_id = t2.id " +
            "left join tbl_plan t3 on t2.plan_id = t3.id " +
            "where t1.id = #{id} ")
    int selectPlanTypeByVoucherId(@Param("id")String id);
}